<?php
require_once ('../../config/include_paths.php');
require_once('config.php');
require_once('dbconnect.php');	// database connect script.
$ID_FIELD				= $_POST['id'];
$value				 	= $_POST['value'];
$table					= $_POST['table'];
$fieldpos				= strpos($ID_FIELD, '_');
$field					= substr($ID_FIELD, $fieldpos + 1);
$id						= substr($ID_FIELD, 0, $fieldpos);

$query = "UPDATE $table SET $field = '" . $value . "' WHERE id = " . $id;

mysql_query($query) or die('Error, update query failed ('.$query.')');
echo $value;

?>